<script language="JavaScript"> 
function WriteDemo(){   
	var f;   
	var fso   =   new   ActiveXObject("Scripting.FileSystemObject")   
	f   =   fso.OpenTextFile("c:\\testfile.txt",   2,   true)   
	f.Write("Hello world 123!");   
	f.Close();  
} 
function ReadDemo(){   
	var fso   =   new   ActiveXObject("Scripting.FileSystemObject");
	f   =   fso.OpenTextFile("c:\\testfile.txt",   1);   
	return f.ReadLine();   
} 

WriteDemo();
var a = ReadDemo();
alert(a)
</script>